package com.awesumgames.awesum;

import com.awesumgames.awesum.AwesumGlobal.Awesum;
import com.awesumgames.awesum.AwesumRenderer;
import com.awesumgames.awesum.Game;

import android.content.Context;
import android.util.AttributeSet;
import android.opengl.GLSurfaceView;

public class AwesumView extends GLSurfaceView {
	//public Game game;
	private AwesumRenderer renderer;

	public AwesumView(Context context) {
		super(context);
		init();
	}

	public AwesumView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

    private void init() {
    	Awesum.debug("view init");
    	setEGLContextClientVersion(2);
        renderer = new AwesumRenderer();
        setRenderer(renderer);
        //game = ((AwesumRenderer)renderer).game;
    }
    
    public void setAccelerometerData(float[] data) {
    	Game.accelerometer.set(data[1], data[0], data[2]); //this applies only to landscape
    }
}
